'''
媒体库删除接口
'''

import allure
import requests
import conftest
from common.logger import Log

@allure.feature('媒体库模块')
class Test_getMedia():

    def setup_method(self):
        # 定义登录接口URL地址
        self.deleteMedia_url = "http://192.168.3.182:9990/airservice-device/media/deleteMedia"
        self.log = Log("媒体库删除接口").get_logger()


    # case01 媒体库详情接口
    @allure.step(title="媒体库删除接口")
    def test_deleteMedia_case01(self):

        self.deleteMedia_data = {
                                "fileIdList": [
                                    730
                                ]
                            }

        response = requests.post(url=self.deleteMedia_url, json=self.deleteMedia_data, headers=conftest.headers_data)

        #添加断言
        assert response.json().get("message") == "success"
        assert  response.json().get("success") == True

        self.log.info("{}".format(response.json()))